package pers.wensheng.patterns.creator_pattern.builder_pattern.common_usage;

import pers.wensheng.patterns.creator_pattern.builder_pattern.common_usage.builder.MobikeBuilder;
import pers.wensheng.patterns.creator_pattern.builder_pattern.common_usage.entity.Bike;

/**
 *  对于用户来说不关注底层或者内部这个复杂对象他的这个构建的过程和构建的算法
 *  有些情况下需要简化系统结构，可以把指挥者类和抽象建造者进行结合
 */
public class Client {
    public static void main(String[] args) {
        //创建指挥者对象
        Director director = new Director(new MobikeBuilder());
        //让指挥者指挥组装自行车
        Bike bike = director.construct();

        System.out.println(bike.getFrame());
        System.out.println(bike.getSeat());

        Bike bike1 = new MobikeBuilder().construct();
        System.out.println(bike1);

    }
}
